xl: use libxl_retrieve_domain_configuration and JSON format
authorWei Liu <wei.liu2@citrix.com>
Tue, 16 Sep 2014 10:01:17 +0000 (11:01 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 17 Sep 2014 19:00:00 +0000 (20:00 +0100)
commite6afc7063afe06f4609fb2d18fde28f3b54e995e
tree8a3db33630d70785f866665f2a82cf42daafc341
parent12ebbe2bae28c0e170e76f61ade65b980ae36b55
xl: use libxl_retrieve_domain_configuration and JSON format

Before this change, xl stores domain configuration in "xl" format, which
is in fact a verbatim copy of user supplied domain config.

Now libxl provides a new API to retrieve domain configuration, switch to
that new API, store configuration in JSON format.

Tests done so far (xl.{new,old} denotes xl with{,out} "libxl-json"
support):

1. xl.new create then xl.new save, hexdump saved file: domain config
   saved in JSON format
2. xl.new create, xl.new save then xl.old restore: failed on
   mandatory flag check
3. xl.new create, xl.new save then xl.new restore: succeeded
4. xl.old create, xl.old save then xl.new restore: succeeded
5. xl.new create then local migrate, receiving end xl.new: succeeded
6. xl.old create then local migrate, receiving end xl.new: succeeded

Note that "xl" config is still supported and handled when restarting a
domain. "xl" config file takes precedence over "libxl-json" in that
case, so that user who uses "config-update" to store new config file
won't have regression. All other scenarios (migration, domain listing
etc.) now use the new API.

Lastly, print out warning when users invoke "config-update" to
discourage them from using this command.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
docs/man/xl.pod.1
tools/libxl/xl_cmdimpl.c
tools/libxl/xl_cmdtable.c